const http = require('http');
const fs = require('fs');
const port = 8080;
http.createServer((req,res)=>{
    //不管客户端请求什么路径，全部只返回根html文件
    fs.readFile('./15.滚动行为.html','utf-8',(err,data)=>{
        if(err){
            console.log('Not Found')
            res.end('Not Found');
        }else{
            res.writeHead(200,{
                'Content-Type':'text/html;charset=utf-8'
            });
            res.end(data);
        }
    })
}).listen(port,()=>console.log(`server listen ${port}`));
